<template>
  <div class="delist">
    <div class="statusBardom" :style="{'height':tabH+'px'}" v-if="showBar"></div>
    <div class="delist_bg">
      <div :class="['delist_nav',showBar? 'white_bar':'']" :style="{'top':tabH+'px'}">
        <van-icon @click="onClickLeft" class="left_icon" name="arrow-left" />
        <div class="delist_nav_tit">我们脱单了</div>
        <div></div>
      </div>
    </div>
    <div class="delist_main">
      <div class="delis_item" v-for="item in delistList" :key="item.id">
        <image class="match_mark_avator" :src="item.wedImage"></image> 
        <div class="delis_box">
          <div class="wed_titl">月老相亲</div>
          <div class="wed_mark">{{ item.mark }}</div>
          <div class="comment">{{ item.comment }}</div>
          <div class="wed_pics">
            <image class="match_img" :style="{
              width:item.photos.length>2 ? '100px' : '30px',
              height:item.photos.length>2 ? '100px' : '30px',
              'border-radius':item.photos.length > 2 ? '8px' : '4px'
            }" :src="v.avatar" v-for="(v,index) in item.photos" :key="index"></image>
          </div>
          <div class="wed_bot">
            <div class="wed_bot_date">{{ item.date }}</div>
            <div class="wed_bot_r">
              <div class="wed_zan">
                <van-icon name="thumb-circle-o" />
                <span class="wed_num">{{ item.thumbNumber }}</span>
              </div>
              <div class="wed_zan">
                <van-icon name="comment-circle-o" />
                <span class="wed_num">{{  item.msgNumber}}</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  export default {
    data(){
      return{
        tabH:0,
        showBar:false,
        delistList:[],
        matchMarker:{
          wedImage:'/static/txn.jpeg',
          mark:'无一国庆节表白日',
          comment:'这是一个新的派对,这个小伙子很激进,最终有情人终成眷属',
          date:'2023-05-30',
          thumbNumber:1,
          msgNumber:2,
          photos:[
            {avatar:'/static/txn.jpeg',name:'聊天尼尔'},
            {avatar:'/static/txw.jpeg',name:'聊天尼尔'},
            {avatar:'/static/txn.jpeg',name:'聊天尼尔'},
            {avatar:'/static/txw.jpeg',name:'聊天尼尔'},
          ]
        }

      }
    },
    mounted(){
      this.tabH = uni.getSystemInfoSync().statusBarHeight;
      this.delistList = new Array(10).fill(this.matchMarker,0,10);
    },
    methods:{
      onClickLeft(){
        uni.navigateBack({delta:1})
      }
    },
    onPageScroll(e){
     this.showBar =  e.scrollTop>=170
    }
  }
</script>
<style lang="scss" scoped>
.delist{
  background-color: #f7f7f7;
  .statusBardom{
    background-color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
  }
  .delist_nav{
    position: fixed;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    height: 40px;
    padding:0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 20px;
    color: #fff;
  }
  .white_bar{
    color: #000;
    background-color: #fff;
  }
}
.delist_bg{
  width: 100%;
  height: 300px;
  background: url('../images/delist_bg.png') no-repeat center;
  background-size: cover;
}
.delist_main{
  margin:-50px 15px 0;
  background-color: #fff;
  border-radius: 5px;
  box-sizing: border-box;
  padding:30rpx;
  .delis_item{
    margin-top: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f7f7f7;
    display: flex;
    &:first-child{
      margin-top: 0;
    }
    .match_mark_avator{
      border-radius: 50%;
      height: 50px;
      width: 50px;
      margin-right: 10px;
    }
    .delis_box{
      flex: 1;
      font-size: 14px;
      .wed_titl{
        color: #333;
        margin-bottom: 5px;
      }
      .wed_mark{
        color: #1C6AD7;
        margin-bottom: 5px;
        &::before{
          content: ' “ ';
        }
        &::after{
          content: ' ” ';
        }
      }
      .wed_pics{
        margin-top: 5px;
        display: flex;
        flex-wrap: wrap;
        .match_img{
          margin-bottom: 5px;
          margin-right: 5px;
          
        }
      }
      .wed_bot{
        margin-top: 5px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        .wed_bot_date{
          color: #333;
        }
        .wed_bot_r{
          display: flex;
          font-size: 12px;
          .wed_zan{
            color: #999999;
            display: flex;
            align-items: center;
            :last-child{
              margin-left: 10px;
            }
            .wed_num{
              margin-left: 5px;
              color: #333;
            }
          }
        }
      }
    }
  }
}
</style>